<%@taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="util" uri="/WEB-INF/kdd-util.tld" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<sec:authorize access="isAuthenticated()">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        </head>
        <body>
            <jsp:include page="menu.jsp" />
            <h6><spring:message code="msg.choosesubprojectandmethod" />:</h6>
            <div class="well notfull">
                <div class="controls">
                    <label class="control-label"><spring:message code="msg.subprojects" />:</label>
                    <select class="submulti">
                        <c:forEach items="${subProjects}" var="sp">
                            <option value="${sp.id}">${sp.name}</option>
                        </c:forEach>
                    </select>
                </div><br />
                <div class="controls">
                    <label class="control-label"><spring:message code="msg.methods" />:</label>
                    <select class="methmulti">
                        <c:forEach items="${methods}" var="p">
                            <option value="${p.name}">${p.name}</option>
                        </c:forEach>
                    </select>
                </div><br />
                <a id="submitLink" class="btn btn-primary"><spring:message code="msg.next" /></a>
            </div>
            <script type="text/javascript">
                $(".submulti").chosen();
                $(".methmulti").chosen();
                $("#submitLink").click(function() {
                    var link = "<c:url value='/create/project/' />";
                    var lval = link + ${projectId} + "/subproject/" + $(".submulti").val() + "/method/" + $(".methmulti").val();
                    window.location.href = lval;
                });
            </script>
            <jsp:include page="foot.jsp" />
        </sec:authorize>